home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / emulators / lxrun-FAQ < prev    next >
Text File  |  1997-08-26  |  8KB  |  252 lines

  1.                    ===== === ====
  2.                    lxrun FAQ v1.1
  3.                    ===== === ====
  4.  
  5.           by Steve Ginzburg <stevieg@cco.caltech.edu>
  6.                  with modifications by Ron Record <rr@sco.com>
  7.  
  8.             (last modified: Aug 26, 1997)
  9.  
  10. Index:
  11. -----
  12.  
  13.  Section 0: The Basics
  14.  
  15.     Q0.0:  What is "lxrun"?
  16.  
  17.     Q0.1:  That sounds awesome!  Tell me very quickly how I can
  18.        get started using lxrun!
  19.  
  20.     Q0.2:  How does lxrun work?
  21.  
  22.     Q0.3:  That's brilliant.  Who was the genius who came up with lxrun?
  23.  
  24.  
  25.  Section 1: Using lxrun
  26.  
  27.     Q1.0:  What binary formats does lxrun support?
  28.  
  29.     Q1.1:  What does lxrun need in order to work?
  30.  
  31.     Q1.2:  How can I run Linux applications that use audio?
  32.  
  33.     Q1.3:  What sorts of Linux binaries work well with lxrun?
  34.  
  35.  
  36.  Section 2: Adding System Calls to lxrun
  37.  
  38.     Q2.0:  How complete is lxrun?
  39.  
  40.     Q2.1:  What if I find a Linux binary that lxrun doesn't support?
  41.  
  42.  
  43.  Section 3: Troubleshooting
  44.  
  45.     Q3.0:  What does "linuxemul:  fatal error:  program load failed:  No
  46.        such file or directory" mean?
  47.  
  48.     Q3.1:  What does "progname:  can't load library 'some_library_name.so'"
  49.        mean?
  50.  
  51.     Q3.2:  Why are my Linux binaries unable to find their data files?
  52.  
  53.     Q3.3:  What should i do if i find a problem with lxrun ?
  54.  
  55.  
  56.  
  57.                === Section 0: The Basics ===
  58.  
  59. Q0.0: What is "lxrun"?
  60.  
  61.    A: It is a Linux emulator for SCO OpenServer and UnixWare machines.
  62.  
  63.  
  64. Q0.1:  That sounds awesome!  Tell me very quickly how I can get
  65.        started using lxrun!
  66.  
  67.    A:  Follow these steps:
  68.  
  69.     0. Unpack lxrun-0.8.6.cpio.gz.
  70.            Do this as "root" from the root directory (/).
  71.            Issue the commands (assuming you downloaded into /tmp) :
  72.              # cd /
  73.              # gzcat /tmp/lxrun-0.8.6.cpio.gz | cpio -icdvu
  74.            The lxrun distribution should extract into the
  75.            etc and usr/local directories.
  76.  
  77.     1. Copy a Linux binary to the /usr/local/linux/bin directory
  78.            If you don't have a Linux system at hand, use one of the
  79.            mirrors at ftp://sunsite.unc.edu/pub/Linux/welcome.html
  80.            to download an app off the net.
  81.  
  82.     2. Create a symbolic link to "lxfront" as follows :
  83.            # ln -s /usr/local/linux/bin/lxfront /usr/local/bin/<app-name>
  84.            where "<app-name>" refers to the name of the Linux binary.
  85.  
  86.     3. Type "/usr/local/bin/<app-name>" 
  87.  
  88.     3b. Optionally, set the environment variable LINUX_ROOT to
  89.         "/usr/local/linux" and execute your Linux applications
  90.             by running "lxrun <app-pathname>" where "<app-pathname>"
  91.             refers to the Linux application path (lxfront does this
  92.             for you).
  93.  
  94.  
  95. Q0.2: How does lxrun work?
  96.  
  97.    A: It works by remapping system calls on the fly.  As it turns
  98.       out, there's not much difference between Linux and SCO
  99.       binaries.  The main difference is the way in which system
  100.       calls are handled.  In Linux, an "int 80" instruction is
  101.       used, which jumps to the system-call-handling portion of
  102.       the Linux kernel.  On SCO systems, "int 80" causes a
  103.       SIGSEGV signal.  lxrun intercepts these signals and calls
  104.       the SCO equivalent of the system call that the Linux
  105.       program attempted.  The result is that the Linux binary
  106.       runs (with the help of lxrun) on the SCO platform with a
  107.       small (often negligible) performance penalty.  All this is
  108.       accomplished without modifying the kernel.
  109.  
  110.  
  111. Q0.3: That's brilliant.  Who was the genius who came up with lxrun?
  112.  
  113.    A: Michael Davidson, an engineer at SCO.
  114.  
  115.  
  116.  
  117.                === Section 1: Using lxrun ===
  118.  
  119. Q1.0: What binary formats does lxrun support?
  120.  
  121.    A: lxrun understands Intel Linux a.out and ELF format
  122.    binaries.
  123.  
  124.  
  125. Q1.1: What does lxrun need in order to work?
  126.  
  127.    A: To run most Linux programs, lxrun requires the help of the
  128.       Linux dynamic loader (ld.so) and whatever Linux shared
  129.       libraries are required by the program.  Follow the steps
  130.       in Q0.1 above to set up lxrun.
  131.  
  132.  
  133. Q1.2: How can I run Linux applications that use audio?
  134.  
  135.       If you want to run a program that uses audio, get a copy
  136.       of the OSS drivers from:
  137.  
  138.     http://www.sco.com/skunkware/audiovis/index.html#4front
  139.  
  140.       for 100% soundblaster compatible cards or:
  141.  
  142.           http://www.4front-tech.com/
  143.  
  144.       for other sound cards.
  145.  
  146.  
  147. Q1.3: What sorts of Linux binaries work well with lxrun?
  148.  
  149.    A: X applications seem to work well.  Curses programs often
  150.       seem to leave the stty settings in strange states.  (This
  151.       is because the termio ioctls are not handled well by
  152.       lxrun.  Anybody want to fix this?)
  153.  
  154.       In particular, xdoom and raplayer (RealAudio client) seem
  155.       to work well.
  156.  
  157.  
  158.            === Section 2: Adding System Calls to lxrun ===
  159.  
  160. Q2.0: How complete is lxrun?
  161.  
  162.    A: Somewhat complete.  Obviously, the more system calls lxrun is
  163.       able to translate, the more complete its emulation
  164.       capabilities.  In this release, lxrun has a _lot_ of
  165.       unimplemented system calls, but they are calls that are
  166.       not used very often.  So lxrun can successfully run _many_
  167.       Linux binaries.
  168.  
  169.  
  170. Q2.1: What if I find a Linux binary that lxrun doesn't support?
  171.  
  172.    A: Follow these simple steps:
  173.  
  174.     0. Go to http://www.sco.com/skunkware and make
  175.     sure you have the most recent version of lxrun.  If not,
  176.     download the latest one and try it.  We are updating
  177.     lxrun with new system calls all the time.
  178.  
  179.     1. Recompile lxrun with the TRACE option enabled.  (This
  180.     requires modifying one line in the Makefile.)  This will
  181.     cause lxrun to produce a history of all system calls
  182.     used by the binary as it was run (similar to the
  183.     "truss" and "trace" commands).  The trace dump will be
  184.     created in a file called "lxrun.log".
  185.  
  186.     2. Try to narrow down exactly which system call failed.
  187.     Most likely, the failure will be due to a system call
  188.     that has not yet been implemented in lxrun.
  189.  
  190.     3. Implement the system call mapping.  This is usually
  191.     pretty easy to do.  The vast majority of lxrun's code
  192.     does mappings of this sort, so you can pick out almost
  193.     any source file to see how it is done.  Chances are, the
  194.     system call you need to remap is already in one of the
  195.     lxrun source files, but its code looks something like
  196.     this:
  197.  
  198.     int lx_flock()        { errno = ENOSYS; return -1; }    
  199.  
  200.     This means that you're the first person who has gotten
  201.     around to mapping that particular system call.
  202.  
  203.     4. After making your modification, recompile lxrun and
  204.     see if it works.  You may have to remap more than one
  205.     system call to get your binary working!
  206.  
  207.     5. E-Mail your changes to skunkware@sco.com.  This way,
  208.     we can put your changes into the next release of lxrun.
  209.  
  210.     6. If steps 1-5 seem are beyond your programming
  211.     ability, contact skunkware@sco.com and maybe one of the
  212.     Skunk team will have time to give you a hand with it.
  213.     Make sure to tell us exactly what program you're having
  214.     trouble with.
  215.  
  216.  
  217.              === Section 3: Troubleshooting ===
  218.  
  219. Q3.0: What does "linuxemul: fatal error: program load failed: No
  220.       such file or directory" mean?
  221.  
  222.    A: It probably means you have your LINUX_ROOT environment
  223.       variable set up incorrectly.
  224.  
  225.  
  226. Q3.1: What does "progname: can't load library 'some_library_name.so'"
  227.       mean?
  228.  
  229.    A: It means you're missing a shared library that is needed to
  230.       run a particular binary.  You can either try to find a
  231.       compiled version of the library from a Linux ftp site
  232.       (such as ftp://sunsite.unc.edu/pub/Linux/libs/) or if you
  233.       have access to a running Linux system, you can copy the
  234.       library directly.  You should put the library in
  235.       $LINUX_ROOT/lib on your SCO system.
  236.  
  237.  
  238. Q3.2: Why are my Linux binaries unable to find their data files?
  239.  
  240.    A: To aid in the emulation process, lxrun prepends the contents
  241.       of the $LINUX_ROOT variable too many common pathnames.  Try
  242.       putting your program's data files in $LINUX_ROOT/whatever
  243.       instead of /whatever.
  244.  
  245. Q3.3: What should i do if i find a problem with lxrun ?
  246.  
  247.    A: Please report any difficulty you have with lxrun by e-mailing
  248.       skunkware@sco.com. Feel free to include suggestions, comments, 
  249.       code modifications, extensions, ...
  250.  
  251. -------
  252.